{extend name="public:base"}
{block name="body"}
	<body class="pear-container">
	    <!--统计-->
		<div class="layui-row layui-col-space10">
		    <div class="layui-col-xs12 layui-col-md6">
		        <div class="layui-card top-panel">
					<div class="layui-card-header">会员</div>
					<div class="layui-card-body" style="text-align:center;">
					    <div class="layui-row layui-col-space5">
					        <div class="layui-col-xs12" style="font-size:29px;border-bottom:1px solid #eee;line-height:60px;" id="user_all">
					                {$count['user_all']}
					        </div>
			                <div class="layui-col-xs3" style="line-height:30px; border-right:1px solid #eee">
			                    <span style="color:gray;">注册会员</span><br>
			                    <span style="font-size:20px;" id="user_register">{$count['user_register']}</span>

			                </div>
			                <div class="layui-col-xs3" style="line-height:30px; border-right:1px solid #eee">
			                    <span style="color:gray;">合伙人</span><br>
			                    <span style="font-size:20px;" id="user_one">{$count['user_one']}</span>

			                </div>
			                <div class="layui-col-xs3" style="line-height:30px; border-right:1px solid #eee">
			                    <span style="color:gray;">高级合伙人</span><br>
			                    <span style="font-size:20px;" id="user_two">{$count['user_two']}</span>

			                </div>
			                <div class="layui-col-xs3" style="line-height:30px;">
			                    <span style="color:gray;">资深合伙人</span><br>
			                    <span style="font-size:20px;" id="user_three">{$count['user_three']}</span>
			                </div>


					    </div>
					</div>
				</div>
		    </div>
		    <div class="layui-col-xs6 layui-col-md3">
		        <div class="layui-card top-panel">
					<div class="layui-card-header">订单数</div>
					<div class="layui-card-body" style="text-align:center;">
					  <div class="layui-row layui-col-space5">
					    <div class="layui-col-xs12" style="font-size:29px;border-bottom:1px solid #eee;line-height:60px;" id="order_count">
					       {$order['count']}
				        </div>
					    <div class="layui-col-xs6" style="border-right:1px solid #eee;line-height:30px;">
			                <span style="color:gray;">业务订单</span><br>
	                        <span style="font-size:20px;" id="product_count">{$order['product_count']}</span>
					     </div>
					     <div class="layui-col-xs6" style="line-height:30px;">
			                <span style="color:gray;">商城订单</span><br>
	                        <span style="font-size:20px;" id="shop_count">{$order['shop_count']}</span>
					     </div>
					  </div>
					</div>
				</div>
		    </div>
		    <div class="layui-col-xs6 layui-col-md3">
		        <div class="layui-card top-panel">
					<div class="layui-card-header">订单成交额</div>
					<div class="layui-card-body" style="text-align:center;">
					  <div class="layui-row layui-col-space5">
					    <div class="layui-col-xs12" style="font-size:29px;border-bottom:1px solid #eee;line-height:60px;" id="order_sum">
					       {$order['sum']}
				        </div>
					    <div class="layui-col-xs6" style="border-right:1px solid #eee;line-height:30px;">
			                <span style="color:gray;">业务订单</span><br>
	                        <span style="font-size:20px;" id="product_sum">{$order['product_sum']}</span>
					     </div>
					     <div class="layui-col-xs6" style="line-height:30px;">
			                <span style="color:gray;">商城订单</span><br>
	                        <span style="font-size:20px;" id="shop_sum">{$order['shop_sum']}</span>
					     </div>
					  </div>
					</div>
				</div>
		    </div>
		</div>
		<!--形势图1-->
	    <div class="layui-row layui-col-space10">
			<div class="layui-col-xs12 layui-col-md9">
				<div class="layui-card">
				    <div class="layui-card-header">最近30天会员加入形势图</div>
					<div class="layui-card-body">
						<div class="layui-tab custom-tab layui-tab-brief" lay-filter="docDemoTabBrief">
							<div id="echarts-records1" style="background-color:#ffffff;min-height:440px;padding: 10px"></div>
						</div>
					</div>
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-md3">
				<div class="layui-card">
				    <div class="layui-card-header">下级合伙人排行榜</div>
				    <div class="layui-card-body" style="height:460px;">
				        <table class="layui-table" lay-skin="line">
                            <thead>
                                <tr>
                                    <th>排名</th>
                                    <th>名称</th>
                                    <th>数量</th>
                                </tr> 
                            </thead>
                            <tbody>
                                {volist name="user" id="vo"}
                                <tr>
                                <td>{$key+1}</td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.inv_num}</td>
                                </tr>
                                {/volist}
                            </tbody>
                        </table>
				    </div>
				</div>
			</div>
		</div>	
		<!--形势图2-->
	    <div class="layui-row layui-col-space10">
			<div class="layui-col-xs12 layui-col-md9">
				<div class="layui-card">
				    <div class="layui-card-header">最近30天订单形势图</div>
					<div class="layui-card-body">
						<div class="layui-tab custom-tab layui-tab-brief" lay-filter="docDemoTabBrief">
							<div id="echarts-records2" style="background-color:#ffffff;min-height:440px;padding: 10px"></div>
						</div>
					</div>
				</div>
			</div>
			<div class="layui-col-xs12 layui-col-md3">
				<div class="layui-card">
				    <div class="layui-card-header">合伙人分润排行榜</div>
				    <div class="layui-card-body"  style="height:460px;">
				        <table class="layui-table" lay-skin="line">
                            <thead>
                                <tr>
                                    <th>排名</th>
                                    <th>名称</th>
                                    <th>金额</th>
                                </tr> 
                            </thead>
                            <tbody>
                                {volist name="brokerage" id="vo"}
                                <tr>
                                <td>{$key+1}</td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.price_count}</td>
                                </tr>
                                {/volist}
                            </tbody>
                        </table>
				    </div>
				</div>
			</div>
		</div>
	</body>
{/block} 
{block name="custome"}
{/block}
{block name="script"} 
<script>
    layui.use(['table',  'jquery', 'common', 'count','echarts'], function () {
        let $ = layui.jquery;
        let common = layui.common;
        let count = layui.count;
        let echarts = layui.echarts;
        count.up('user_all',{
            'time':50,
            'num':{$count['user_all']},
            'regulator':1,
        });
        count.up('user_register',{
            'time':40,
            'num':{$count['user_register']},
            'regulator':1,
        });
        count.up('user_one',{
            'time':40,
            'num':{$count['user_one']},
            'regulator':1,
        });
        count.up('user_two',{
            'time':40,
            'num':{$count['user_two']},
            'regulator':1,
        });
        count.up('user_three',{
            'time':40,
            'num':{$count['user_three']},
            'regulator':1,
        });
        count.up('order_count',{
            'time':60,
            'num':{$order['count']},
            'regulator':1,
        });
        count.up('product_count',{
            'time':60,
            'num':{$order['product_count']},
            'regulator':1,
        });
        count.up('shop_count',{
            'time':40,
            'num':{$order['shop_count']},
            'regulator':1,
        });
        count.up('order_sum',{
            'time':60,
            'num':{$order['sum']},
            'regulator':1,
            'bit':2
        });
        count.up('product_sum',{
            'time':60,
            'num':{$order['product_sum']},
            'regulator':1,
            'bit':2
        });
        count.up('shop_count',{
            'time':60,
            'num':{$order['shop_sum']},
            'regulator':1,
            'bit':2
        });
        let xAxisData = {:json_encode($date)};
        let data1 = {:json_encode($num)};
        let data2 = {:json_encode($ones)};
        let data3 = {:json_encode($tows)};
        let data4 = {:json_encode($threes)};
        let data5 = {:json_encode($fours)};
        let echartsRecords1 = echarts.init(document.getElementById('echarts-records1'), 'walden');
        let echartsRecords2 = echarts.init(document.getElementById('echarts-records2'), 'walden');
        let emphasisStyle = {
              itemStyle: {
                shadowBlur: 10,
                shadowColor: 'rgba(0,0,0,0.3)'
              }
            };
        let option = {
              legend: {
                data: ['会员', '注册会员', '合伙人', '高级合伙人','资深合伙人'],
                left: '10%'
              },
              brush: {toolbox: ['clear'],
                xAxisIndex: 0
              },
              toolbox: {
                feature: {
                  magicType: {
                    type: ['stack']
                  },
                  dataView: {}
                }
              },
              tooltip: {},
              xAxis: {
                data: xAxisData,
                name: '日期',
                axisLine: { onZero: true },
                splitLine: { show: false },
                splitArea: { show: false }
              },
              yAxis: {},
              grid: {
                bottom: 100
              },
              series: [
                {
                  name: '会员',
                  type: 'bar',
                  stack: 'one',
                  emphasis: emphasisStyle,
                  data: data1
                },
                {
                  name: '注册会员',
                  type: 'bar',
                  stack: 'one',
                  emphasis: emphasisStyle,
                  data: data2
                },
                {
                  name: '合伙人',
                  type: 'bar',
                  stack: 'one',
                  emphasis: emphasisStyle,
                  data: data3
                },
                {
                  name: '高级合伙人',
                  type: 'bar',
                  stack: 'one',
                  emphasis: emphasisStyle,
                  data: data4
                },
                {
                  name: '资深合伙人',
                  type: 'bar',
                  stack: 'one',
                  emphasis: emphasisStyle,
                  data: data5
                }
              ]
            };
			echartsRecords1.setOption(option);
        let options = {
            color:[
        '#32C5E9',
        '#96BFFF',
        '#E690D1',
        '#67E0E3',
        '#e7bcf3',
        '#9d96f5',
        '#8378EA',
        '#96BFFF',
        '#32C5E9',
        '#37A2DA'],
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'cross',
                  crossStyle: {
                    color: '#999'
                  }
                }
              },
              toolbox: {
                feature: {
                  dataView: { show: false, readOnly: false },
                  magicType: { show: false, type: ['line', 'bar'] },
                  restore: { show: false },
                  saveAsImage: { show: false }
                }
              },
              legend: {
                data: ['订单数', '业务订单数', '商城订单数','订单成交数','业务成交数','商城成交数','订单成交额','业务成交额','商城成交额']
              },
              xAxis: [
                {
                  type: 'category',
                  name:'日期',
                  data: xAxisData,
                  axisPointer: {
                    type: 'shadow'
                  }
                }
              ],
              yAxis: [
                {
                  type: 'value',
                  name: '额度',
                  axisLabel: {
                    formatter: '{value}  元'
                  }
                },
                {
                  type: 'value',
                  name: '数量',
                  interval:1,
                  axisLabel: {
                    formatter: '{value}'
                  }
                }
              ],
              series: [
                
                {
                  name: '订单数',
                  type: 'line',
                   yAxisIndex: 1,
                  tooltip: {
                    valueFormatter: function (value) {
                      return value;
                    }
                  },
                  data: {:json_encode($productNum)}
                },
                {
                  name: '业务订单数',
                  type: 'line',
                   yAxisIndex: 1,
                  tooltip: {
                    valueFormatter: function (value) {
                      return value;
                    }
                  },
                  data: {:json_encode($productNum1)}
                },
                {
                  name: '商城订单数',
                  type: 'line',
                   yAxisIndex: 1,
                  tooltip: {
                    valueFormatter: function (value) {
                      return value;
                    }
                  },
                  data: {:json_encode($shopNum1)}
                },
                {
                  name: '订单成交数',
                  type: 'line',
                   yAxisIndex: 1,
                  tooltip: {
                    valueFormatter: function (value) {
                      return value;
                    }
                  },
                  data: {:json_encode($shopNum)}
                },
                {
                  name: '业务成交数',
                  type: 'line',
                   yAxisIndex: 1,
                  tooltip: {
                    valueFormatter: function (value) {
                      return value;
                    }
                  },
                  data: {:json_encode($productNum2)}
                },
                {
                  name: '商城成交数',
                  type: 'line',
                   yAxisIndex: 1,
                  tooltip: {
                    valueFormatter: function (value) {
                      return value;
                    }
                  },
                  data: {:json_encode($shopNum2)}
                },
                {
                  name: '订单成交额',
                  type: 'bar',
                  tooltip: {
                    valueFormatter: function (value) {
                      return value+ ' 元';
                    }
                  },
                  data: {:json_encode($shopBrokerage)}
                },
                {
                  name: '业务成交额',
                  type: 'bar',
                  tooltip: {
                    valueFormatter: function (value) {
                      return value + ' 元';
                    }
                  },
                  data: {:json_encode($productBrokerage2)}
                },
                {
                  name: '商城成交额',
                  type: 'bar',
                  tooltip: {
                    valueFormatter: function (value) {
                      return value + ' 元';
                    }
                  },
                  data: {:json_encode($shopBrokerage2)}
                },
              ]
            };
            echartsRecords2.setOption(options);
				window.onresize = function() {
					echartsRecords1.resize();
					echartsRecords2.resize();
				}
    })
</script>
{/block}
</html>
